<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Utils\StrUtil;

class Eloquent extends Model
{
    protected function serializeDate(\DateTimeInterface $date)
    {
        return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
    }

    public static function makeUuid(): string
    {
        return StrUtil::makeUuid();
    }

    const ENABLE_YES = 1;
    const ENABLE_NOT = 0;

    public static $enable_maps = [
        self::ENABLE_YES => '上架',
        self::ENABLE_NOT => '下架'
    ];
}
